package com.beesphere.excel.writer.tests;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;

import com.beesphere.excel.writer.ExcelWriterException;
import com.beesphere.excel.writer.impls.xml.XmlToExcelConverter;

public class BasicTest {
	
	
	public static void main (String[] args) throws ExcelWriterException, IOException {
		OutputStream output = new FileOutputStream ("files/out.xls");
		XmlToExcelConverter converter = new XmlToExcelConverter (output);
		converter.setCharset (Charset.defaultCharset());
		Map<String, String> tags = new HashMap<String, String> ();
		tags.put("wb", "root");
		tags.put("sh", "data");
		tags.put("rs", "products");
		tags.put("r", "product");
		converter.setTags(tags);
		converter.write (new FileInputStream ("files/in.xml"));
		output.close ();
	}

}
